﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SelectDeptDialog.aspx.cs" Inherits="StudentManage.Web.Admin.SelectInfo.SelectDeptDialog" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>选择用户</title>
    <script src="/js/jquery-1.8.3.min.js" type="text/javascript"></script>
    <script src="/Admin/js/SelectUser.js" type="text/javascript"></script>
    <link href="/Admin/SelectInfo/Css/SelectDeptStyle.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        $(document).ready(function () {
            $("#tvTreeViewck input[type='checkbox'] , .LinkageCheckbox input[type='checkbox']").live('click', function () {
                if ($(this).attr("checked")) {
                    $(this).parents("table").next("div").find("input[type='checkbox']").attr("checked", true);
                }
                else {
                    $(this).parents("table").next("div").find("input[type='checkbox']").attr("checked", false);
                }
            });

        });

        function SelectDeptMent(IsMdalDialog, BMDMS, BMMCS) {
            if (IsMdalDialog == "0") { //非模态窗口
                var selectID = $("#HidSelectID").val();
                $(window.parent.document).find("#" + selectID + " input[id$='_HidDeptID']").val(BMDMS);
                $(window.parent.document).find("#" + selectID + " input[id$='_HidDeptName']").val(BMMCS);
                $(window.parent.document).find("#" + selectID + " input[id$='_txtDeptName']").val(BMMCS);
                $(window.parent.document).find('.tanchuClose').trigger('click'); //关闭当前弹出窗体
            }
            else {
                window.returnValue = BMDMS + "&" + BMMCS;
                window.close();
            } 
        }

        function Verification() {
            var b = true;

            if ($("#HidIsRadio").val() == "1") { //是单选
                if ($("#tvTreeViewck input[type='checkbox'][checked='checked']").length > 1) {
                    b = false;
                    alert("请选择单个部门!");
                }
            }

            if ($("#tvTreeViewck input[type='checkbox'][checked='checked']").length == 0) {
                b = false;
                alert("请选择部门!");
            }

            return b;
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
        <asp:HiddenField ID="HidIsRadio" runat="server" />
        <asp:HiddenField ID="HidSelectID" runat="server" />
        <div id="tvTreeViewck" style="width:380px; height:440px; overflow:auto; border:1px solid #ccc; margin:0px auto;margin-top:10px;">
            <asp:TreeView ID="TV_List" runat="server">
            </asp:TreeView>
        </div>
        <div style="width:400px; text-align:center;">
            <asp:Button ID="btnSelectDept" runat="server" Text="选择" style="width:80px; height:25px;" onclick="btnSelectDept_Click"  />
        </div>
    </ContentTemplate>
    </asp:UpdatePanel>
    </form>
</body>
</html>
